import request from "@/request/";

//分页
export const getList = (data) => {
  return request({
    url: "/api/mes-warehouse-service/transfer-order-wh/page",
    method: "POST",
    data,
  });
};

// 获取详情
export const getDetail = (bizBillId) => {
  return request({
    url: "/api/mes-warehouse-service/transfer-order-wh/detail",
    method: "POST",
    data: {
      bizBillId,
    },
  });
};

export const getRecord = (bizBillId) => {
  return request({
    url: "/api/mes-warehouse-service/transfer-order-wh/operate/records",
    method: "POST",
    data: {
      bizBillId,
    },
  });
};

// 查看详情明细
export const getDetailInner = (data) => {
  return request({
    url: "/api/mes-warehouse-service/transfer-order-wh/barcode/detail",
    method: "POST",
    data,
  });
};

// 获取可用数与库存数
export const getNumInfo = (data) => {
  return request({
    url: "/api/mes-warehouse-service/transfer-order-wh/material/detail",
    method: "POST",
    data,
  });
};

// 新增
export const add = (data) => {
  return request({
    url: "/api/mes-warehouse-service/transfer-order-wh/save",
    method: "POST",
    data,
  });
};

// 更新
export const update = (data) => {
  return request({
    url: "/api/mes-warehouse-service/transfer-order-wh/update",
    method: "POST",
    data,
  });
};

// 删除
export const remove = (data) => {
  return request({
    url: "/api/mes-warehouse-service/transfer-order-wh/delete",
    method: "POST",
    data,
  });
};

// 驳回
export const reject = (data) => {
  return request({
    url: "/api/mes-warehouse-service/transfer-order-wh/reject",
    method: "POST",
    data,
  });
};

// 审核
export const audit = (billId) => {
  return request({
    url: "/api/mes-warehouse-service/transfer-order-wh/approve",
    method: "POST",
    data: { billId },
  });
};

//打印
export const getPrintData = (data) => {
  return request({
    url: "/api/mes-warehouse-service/transfer-order-wh/print",
    method: "POST",
    data,
  });
};

export const getEnum = (keyList) => {
  return request({
    url: "/api/mes-warehouse-service/preset/enum/list",
    method: "POST",
    data: {
      keyList,
    },
  });
};
